﻿using DocumentFormat.OpenXml.Lite.DrawingML.Base;
using DocumentFormat.OpenXml.Lite.DrawingML.Types;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.DrawingML.Text.Properties
{
    [XmlRoot("pPr", Namespace = Constants.Main)]
    public class ParagraphProperties : XmlSerializable
    {
        #region Attributes

        [Optional]
        [XmlAttribute("marL", Form = XmlSchemaForm.Qualified)]
        public Nullable<int> LeftMargin { get; set; }

        [Optional]
        [XmlAttribute("marR", Form = XmlSchemaForm.Qualified)]
        public Nullable<int> RightMargin { get; set; }

        [Optional]
        [XmlAttribute("lvl", Form = XmlSchemaForm.Qualified)]
        public Nullable<int> Level { get; set; }

        [Optional]
        [XmlAttribute("indent", Form = XmlSchemaForm.Qualified)]
        public Nullable<int> Indent { get; set; }

        [Optional]
        [XmlAttribute("algn", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TextAlignType> Alignment { get; set; }

        [Optional]
        [XmlAttribute("defTabSz", Form = XmlSchemaForm.Qualified)]
        public Nullable<int> DefaultTabSize { get; set; }

        [Optional]
        [XmlAttribute("rtl", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> RightToLeft { get; set; }

        [Optional]
        [XmlAttribute("eaLnBrk", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> EastAsianLineBreak { get; set; }

        [Optional]
        [XmlAttribute("fontAlgn", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TextFontAlignType> FontAlignment { get; set; }

        [Optional]
        [XmlAttribute("latinLnBrk", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> LatinLineBreak { get; set; }

        [Optional]
        [XmlAttribute("hangingPunct", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> HangingPunctuation { get; set; }

        #endregion

        #region Elements

        [Optional]
        [XmlElement("lnSpc", Namespace = Constants.Main)]
        public Space LineSpacing { get; set; }

        [Optional]
        [XmlElement("spcBef", Namespace = Constants.Main)]
        public Space SpaceBefore { get; set; }

        [Optional]
        [XmlElement("spcAft", Namespace = Constants.Main)]
        public Space SpaceAfter { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Main)]
        public ITextBulletColor TextBulletColor { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Main)]
        public ITextBulletSize TextBulletSize { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Main)]
        public ITextBulletTypeface TextBulletTypeface { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Main)]
        public ITextBullet TextBullet { get; set; }

        [Optional]
        [XmlElement("tabLst", Namespace = Constants.Main)]
        public TabList TabList { get; set; }

        [Optional]
        [XmlElement("defRPr", Namespace = Constants.Main)]
        public RunProperties RunProperties { get; set; }

        [Optional]
        [XmlElement("extLst", Namespace = Constants.Main)]
        public ExtensionList ExtensionList { get; set; }

        #endregion

        public ParagraphProperties() { }
    }
}
